流式读取游戏崩溃日志,加快日志分析速度 - #6661
Draft
Hylfrd wants to merge 3 commits into
Draft
Conversation
Hylfrd
marked this pull request as draft
August 12, 2026 12:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6640
游戏异常退出后,HMCL 会读取并分析日志。原实现会将完整日志转换成 String 后一次性读取到内存中;当日志过大时,HMCL 可能在崩溃分析过程中发生 OOM。大量日志还会增加日志分析的时间,使崩溃窗口长时间无法得到分析结果。
此 PR 重构了 CrashReportAnalyzer 的日志分析流程:
使用 608 MiB 日志进行测试时,修改后的分析可在 -Xmx256m 下约 8.7 秒完成。若对每个窗口直接运行全部规则,则需要约 161 秒。
注:
1:补充了新的单元测试:
2:第一个单元测试与部分注释由AI完成。